/**
 * 获取url指定参数
 * @param {Object} url 路径
 * @param {Object} name 参数名称
 */
function getQueryString($url, name) {
	var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i"); 
	//var r = window.location.search.substr(1).match(reg); 
	var r = $url.substr(1).match(reg); 
	if (r != null) {
		return unescape(r[2]); 
	}  else {
		return null;
	}
}


 function iframeAutoFit(){
    var ex;
    try{
        if(window != parent){
            var a = parent.document.getElementsByTagName("iframe");
            for(var i = 0; i < a.length; i ++) {
            	if(a[i].contentWindow == window) {
                    var h1 = 0, h2 = 0;
                    if(document.documentElement && document.documentElement.scrollHeight) {
                        h1 = document.documentElement.scrollHeight;
                    }
                    if(document.body){
                    	h2 = document.body.scrollHeight;
                    } 
                    var h = Math.max(h1, h2);
                    if(document.all) {
                    	h += 4;
                    }
                    if(window.opera) {
                    	h += 1;
                    }
                    a[i].style.height = h +"px";
                 }
            }
        }
    }catch (ex){
    	
    }
}


/**
 * 转换时间
 * @param {Object} $conTime
 * @param {Object} $type
 */
function stringConTime($conTime, $type){
	$conTime = Date.parse($conTime.replace(/-/g,"/"));
	var $date = new Date($conTime);
	var $month = $date.getMonth() + 1;
	var $year = $date.getFullYear();
	$month = $month > 9 ? $month : "0" + $month;
	var $day = $date.getDate();
	$day = $day > 9 ? $day :  "0" + $day
	var $retTime = ""
	if($type == "ymd"){
		$retTime = $year + "." + $month + "." + $day;
		return $retTime;
	}
	
	if($type == "ym"){
		$retTime = $year + "." + $month;
		return $retTime;
	}
		
	if($type == "d"){
		$retTime = $day;
		return $retTime;
	}
}